<h1>编辑博客</h1>

<%= form_with(model: @article, local: true) do |form| %>
  <% if @article.errors.any? %>
    <div>
      <h2>
        <%= pluralize(@article.errors.count, "error") %> prohibited
        this article from being saved:
      </h2>
      <u1>
        <% @article.errors.full_messages.each do |msg| %>
          <li><%= msg %></li>
        <% end %>
      </u1>
    </div>
  <% end %>
  <p>
    <%= form.label :标题 %> <br>
    <%= form.text_field :title, class:"form-control" %> <br>
  </p>

  <p>
    <%= form.label :内容 %> <br>
    <%= form.text_area :text , class:"form-control"%>
  </p>

  <p>
    <%= form.submit"更新博客", class:"btn btn-primary"%>
  </p>

<% end %>

<%= link_to 'Back', articles_path ,class:"btn btn-primary"%>
